export default {
  install(Vue) {
    Vue.directive("no-space", {
      bind(el) {
        el.addEventListener("input", () => {
          // 阻止输入框中的空格
          el.value = el.value.replace(/\s/g, "");
          el.dispatchEvent(new Event("input"));
        });
      },
    });
  },
};
